package cre.tomcat.ch04.startup;

import cre.tomcat.ch04.core.SimpleContainer;
import org.apache.catalina.Container;
import org.apache.catalina.connector.http.HttpConnector;

/**
 * tomcat bootstrap
 *
 * @Author penglai
 * @Date 2017/1/4.
 */
public class Bootstrap {

    public static void main(String[] args) {
        HttpConnector connector = new HttpConnector();
        Container container = createContainer();

        try {
            connector.setContainer(container);
            connector.initialize();
            connector.start();

            System.in.read();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    private static Container createContainer() {
        return new SimpleContainer();
    }
}
